<?php
/**
*
* @author Blackpawn blackpawn666@hotmail.com - http://blackpawnsarchives.net
* @co_author GameCharmer admin@gamecharmer.com - http://gaming.gamecharmer.com
* @package Age of Dragons Mod :: ( Game Console Required )
* @version $Id: guide.php 1.1.1 12-26-2009 Blackpawn
* @copyright (c) 2009 Blackpawns Archives
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/

define('GC_MOD', true);
define('IN_PHPBB', true);
define('AOD', true);

$phpbb_root_path =  '../../';
$templates_path = '../../../games/aod/templates/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);

include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . 'includes/mods/game_console/gc_common.' . $phpEx);
include($phpbb_root_path . 'games/aod/common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

// Set custom language path
$user->set_custom_lang_path($phpbb_root_path.'games/aod/language/');

//load our language file
$user->add_lang('common');

// Now add the phpBB language path
$user->set_custom_lang_path($phpbb_root_path . 'language');

// Load the Game Console language file
$user->add_lang('mods/game_console');

if ($user->data['user_id'] == ANONYMOUS)
{
	login_box('', $user->lang['LOGIN']);
}

if ($user->data['is_bot'])
{
	redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
}

// Default Vars
$guide_page = TRUE; // Highlights the guide tab
$error_msgs = null;
$admin = 0;

// Var Requests
$topic = request_var('topic',1);




// Gather some user info
$user_id = $user->data['user_id'];
$account_status = check_account_status($user_id);
if ($account_status == FALSE)
{
	redirect(append_sid("{$phpbb_root_path}/games/index.$phpEx"));
}

// Fetch kingdom data
$king = fetch_kingdom_data($user_id);
$admin_access = $king['admin_access'];
$kingdom_status = $king['kingdom_status'];

// Check to see if this user is a admin staff member
if ($user_id == 2 || $admin_access == 1)
{
	$admin = 1;
}

// Check kingdom status to see if this account is frozen
if($kingdom_status == 1)
{
	// Lets make sure the main admin can't be blocked
	if ($user_id <> 2){
		trigger_error($user->lang['FROZEN'] . back_link());
	}
}
$arrow_img = '<img src="'.$phpbb_root_path.'games/images/arrow.png" border="0" width="9">&nbsp;';

$topics = '<a href="guide.php?topic=1#guide" class="stext">'.$arrow_img.$user->lang['TOPIC_1'].'</a><br />';
$topics .= '<a href="guide.php?topic=2#guide" class="stext">'.$arrow_img.$user->lang['TOPIC_2'].'</a><br />';
$topics .= '<a href="guide.php?topic=3#guide" class="stext">'.$arrow_img.$user->lang['TOPIC_3'].'</a><br />';
$topics .= '<a href="guide.php?topic=4#guide" class="stext">'.$arrow_img.$user->lang['TOPIC_4'].'</a><br />';
$topics .= '<a href="guide.php?topic=5#guide" class="stext">'.$arrow_img.$user->lang['TOPIC_5'].'</a><br />';
$topics .= '<a href="guide.php?topic=6#guide" class="stext">'.$arrow_img.$user->lang['TOPIC_6'].'</a><br />';
$topics .= '<a href="guide.php?topic=7#guide" class="stext">'.$arrow_img.$user->lang['TOPIC_7'].'</a><br />';
$topics .= '<a href="guide.php?topic=8#guide" class="stext">'.$arrow_img.$user->lang['TOPIC_8'].'</a><br />';
$topics .= '<a href="guide.php?topic=9#guide" class="stext">'.$arrow_img.$user->lang['TOPIC_9'].'</a><br />';
$topics .= '<a href="guide.php?topic=10#guide" class="stext">'.$arrow_img.$user->lang['TOPIC_10'].'</a><br />';
$topics .= '<a href="guide.php?topic=11#guide" class="stext">'.$arrow_img.$user->lang['TOPIC_11'].'</a><br />';




$content = $user->lang["CONTENT_$topic"];

// Display an error messages to the user
if($error_msgs){
	$error_msgs = '<span class="errormsg"><b>'.$error_msgs.'</b></span>';
}

include($phpbb_root_path . 'games/aod/includes/page_header.' . $phpEx);

$template->assign_vars(array(
	'TOPICS'				=> $topics,
	'CONTENT'				=> $content,
	)
);

// Output page
page_header($game_name.' - '.$user->lang['GUIDE']);

$template->set_filenames(array(
	'body' => $templates_path.'guide_body.html')
);

page_footer();
?>